<template>
    <div>
        <h1>app test post</h1>
        学号：<input type="text" v-model="stu_id"><br />
        姓名：<input type="text" v-model="stu_name"><br />
        语文：<input type="number" v-model="chinese"><br />
        数学：<input type="number" v-model="math"><br />
        英语：<input type="number" v-model="english"><br />
        理综：<input type="number" v-model="lizong"><br />
        文综：<input type="number" v-model="wenzong"><br />
        <button @click="submit">收集学生成绩提交</button>
    </div>
</template>

<script>
export default {
    data() {
        return {
            stu_id: "",
            stu_name: "",
            chinese: 0,
            math: 0,
            english: 0,
            lizong: 0,
            wenzong: 0,
        };
    },
    methods: {
        submit() {
            let url = "http://localhost:8000/entry_exam";
            let result = this.$http.post(url,
                {
                    stu_id: this.stu_id,
                    stu_name: this.stu_name,
                    chinese: this.chinese,
                    math: this.math,
                    english: this.english,
                    lizong: this.lizong,
                    wenzong: this.wenzong,
                },
                { emulateJSON: true }
            );
            console.log(result);
        }
    }
}
</script>

<style lang="scss" scoped>

</style>